


//
//  CommonBackController.m
//  广告页
//
//  Created by YYY on 2017/2/20.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

#import "CommonBackController.h"

#import "RootViewController.h"

@interface CommonBackController ()

@end

@implementation CommonBackController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    backBtn.frame = CGRectMake(0, 0, 50, 30);
    [backBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
    [backBtn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    // Do any additional setup after loading the view.
}

- (instancetype)init
{
    if (self = [super init])
    {
        self.hidesBottomBarWhenPushed = YES;
        
    }
    return self;
}

-(void)backAction:(UIButton *)backBtn
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
